package leetcode;

import java.util.Arrays;

public class youxiaosanjiaoxinggeshu2 {
    public static int count=0;
//    public static int is_Triangle(int i,int j,int m){
//        if(i+j>m&&i+m>j&&j+m>i){
//            count++;
//        }
//        return count;
//
//    }

    public static int triangleNumber(int[] nums) {
        if(nums==null||nums.length==0){
            return -1;
        }
        for(int i=0;i<=nums.length-1;i++){
            for(int j=i+1;j<=nums.length-1;j++){
                for(int m=j+1;m<=nums.length-1;m++){
                    if(nums[i]+nums[j]>nums[m]&&nums[i]+nums[m]>nums[j]&&nums[j]+nums[m]>nums[i]){
                        count++;
                    }
                }
            }
        }
        return count;

    }

    public static void main(String[] args) {
        int[] array={4,2,3,4};
        int i = triangleNumber(array);
        System.out.println(i);


    }
}
